<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>GeoExt.WMSLegend &mdash; GeoExt v1.1</title>
    <link rel="stylesheet" href="../../../_static/geoext.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../',
        VERSION:     '1.1',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
    <link rel="top" title="GeoExt v1.1" href="../../../index.html" />
    <link rel="up" title="Widgets" href="../widgets.html" />
    <link rel="next" title="GeoExt.ZoomSlider" href="ZoomSlider.html" />
    <link rel="prev" title="GeoExt.VectorLegend" href="VectorLegend.html" />
    
    
    
    
    

  </head>
  <body>
    <div class="header">
        <div class="wrap">
            <h1 id="logo"><a href="../../../index.html">GeoExt</a></h1>
            <ul id="top-nav">
                <li class="first"><a href="../../../docs.html">Documentation</a></li>
                <li><a href="../../../examples.html">Examples</a></li>
                <li><a href="../../../downloads.html">Download</a></li>
                <li><a href="http://trac.geoext.org/">Development</a></li>
            </ul>
            <div id="searchbox">
                <form class="search" action="../../../search.html" method="get">
                    <input id="searchbox-query" type="text" name="q" size="25" value="Search &hellip;" tabindex="3" onblur="if(this.value=='') this.value='Search &hellip;';" onfocus="if(this.value=='Search &hellip;') this.value='';" />
                    <input id="searchbox-submit" type="image" value="Search" src="../../../_static/img/search_icon_green.png" />
                    <input type="hidden" name="check_keywords" value="yes" />
                    <input type="hidden" name="area" value="default" />
                </form>
            </div>
        </div>
    </div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li><a href="../../../index.html">GeoExt</a> &raquo;</li>
          <li><a href="../../index.html" >API Reference</a> &raquo;</li>
          <li><a href="../widgets.html" accesskey="U">Widgets</a> &raquo;</li>
        <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.WMSLegend</span></tt></a></li>
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="../../../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="#"><tt class="docutils literal"><span class="pre">GeoExt.WMSLegend</span></tt></a><ul>
<li><a class="reference external" href="#config-options">Config Options</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="VectorLegend.html"
                                  title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">GeoExt.VectorLegend</span></tt></a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="ZoomSlider.html"
                                  title="next chapter"><tt class="docutils literal"><span class="pre">GeoExt.ZoomSlider</span></tt></a></p>
        </div>
      </div>


    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="geoext-wmslegend">
<h1><a title="GeoExt.WMSLegend" class="reference internal" href="#GeoExt.WMSLegend"><tt class="xref docutils literal"><span class="pre">GeoExt.WMSLegend</span></tt></a><a class="headerlink" href="#geoext-wmslegend" title="Permalink to this headline">¶</a></h1>
<dl class="meta docutils">
<dt>Extends</dt>
<dd><ul class="first last simple">
<li><a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container">Ext.Container</a></li>
<li><a title="GeoExt.LayerLegend" class="reference external" href="LayerLegend.html#GeoExt.LayerLegend"><tt class="xref docutils literal"><span class="pre">GeoExt.LayerLegend</span></tt></a></li>
</ul>
</dd>
<dt>xtype</dt>
<dd><tt class="docutils literal"><span class="pre">gx_wmslegend</span></tt></dd>
</dl>
<dl class="class">
<dt id="GeoExt.WMSLegend">
<em class="property">class </em><tt class="descclassname">GeoExt.</tt><tt class="descname">WMSLegend</tt><big>(</big><em>config</em><big>)</big><a class="headerlink" href="#GeoExt.WMSLegend" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Show a legend image for a WMS layer. The image can be read from the styles
field of a layer record (if the record comes e.g. from a
<a title="GeoExt.data.WMSCapabilitiesReader" class="reference external" href="../data/WMSCapabilitiesReader.html#GeoExt.data.WMSCapabilitiesReader"><tt class="xref docutils literal"><span class="pre">GeoExt.data.WMSCapabilitiesReader</span></tt></a>). If not provided, a
GetLegendGraphic request will be issued to retrieve the image.</p>
<div class="section" id="config-options">
<h2>Config Options<a class="headerlink" href="#config-options" title="Permalink to this headline">¶</a></h2>
<p>Configuration properties in addition to
those listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container">Ext.Container</a>.</p>
<dl class="describe">
<dt>
<tt class="descname">baseParams</tt></dt>
<dd><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">Object</span></tt></dt>
<dd><p class="first">Optional parameters to add to the legend url, this can e.g. be used to
support vendor-specific parameters in a SLD WMS GetLegendGraphic
request. To override the default MIME type of image/gif use the
FORMAT parameter in baseParams.</p>
<div class="last highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">legendPanel</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">LegendPanel</span><span class="p">({</span>
    <span class="nx">map</span><span class="o">:</span> <span class="nx">map</span><span class="p">,</span>
    <span class="nx">title</span><span class="o">:</span> <span class="s1">&#39;Legend Panel&#39;</span><span class="p">,</span>
    <span class="nx">defaults</span><span class="o">:</span> <span class="p">{</span>
        <span class="nx">style</span><span class="o">:</span> <span class="s1">&#39;padding:5px&#39;</span><span class="p">,</span>
        <span class="nx">baseParams</span><span class="o">:</span> <span class="p">{</span>
            <span class="nx">FORMAT</span><span class="o">:</span> <span class="s1">&#39;image/png&#39;</span><span class="p">,</span>
            <span class="nx">LEGEND_OPTIONS</span><span class="o">:</span> <span class="s1">&#39;forceLabels:on&#39;</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">});</span>
</pre></div>
</div>
</dd>
</dl>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">defaultStyleIsFirst</tt></dt>
<dd><tt class="docutils literal"><span class="pre">Boolean</span></tt>
The WMS spec does not say if the first style advertised for a layer in
a Capabilities document is the default style that the layer is
rendered with. We make this assumption by default. To be strictly WMS
compliant, set this to false, but make sure to configure a STYLES
param with your WMS layers, otherwise LegendURLs advertised in the
GetCapabilities document cannot be used.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">labelCls</tt></dt>
<dd><tt class="docutils literal"><span class="pre">String</span></tt>
Optional css class to use for the layer title labels.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">layerRecord</tt></dt>
<dd><a title="GeoExt.data.LayerRecord" class="reference external" href="../data/LayerRecord.html#GeoExt.data.LayerRecord"><tt class="xref docutils literal"><span class="pre">GeoExt.data.LayerRecord</span></tt></a>  The layer record for the legend</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">legendTitle</tt></dt>
<dd><tt class="docutils literal"><span class="pre">String</span></tt>
Optional title to be displayed instead of the layer title.  If this is
set, the value of <tt class="docutils literal"><span class="pre">showTitle</span></tt> will be ignored (assumed to be true).</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">showTitle</tt></dt>
<dd><tt class="docutils literal"><span class="pre">Boolean</span></tt>
Whether or not to show the title of a layer. This can be overridden
on the LayerStore record using the hideTitle property.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">useScaleParameter</tt></dt>
<dd><tt class="docutils literal"><span class="pre">Boolean</span></tt>
Should we use the optional SCALE parameter in the SLD WMS
GetLegendGraphic request? Defaults to true.</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
            <li class="right" style="margin-right: 10px">
              <a href="../../../genindex.html" title="General Index"
                 accesskey="I">index</a></li>
            <li class="right" >
              <a href="../../../modindex.html" title="Global Module Index"
                 accesskey="M">modules</a> |</li>
            <li class="right" >
              <a href="ZoomSlider.html" title="GeoExt.ZoomSlider"
                 accesskey="N">next</a> |</li>
            <li class="right" >
              <a href="VectorLegend.html" title="GeoExt.VectorLegend"
                 accesskey="P">previous</a> |</li>
        <li><a href="../../../index.html">GeoExt</a> &raquo;</li>
          <li><a href="../../index.html" >API Reference</a> &raquo;</li>
          <li><a href="../widgets.html" >Widgets</a> &raquo;</li>
        <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.WMSLegend</span></tt></a></li>
      </ul>
    </div>

    <div class="footer">
      &copy; Copyright 2009-2010, GeoExt Community.
    </div>
  </body>
</html>